// 商品相关接口
import http from "../common/http.js"

export default {
	//获取订单预览数据
	submitPreview: (data, needLoading) => {
		return http.POST('/order/submit-preview', data, needLoading)
	},
	//提交订单
	submit: (data, needLoading) => {
		console.log('data',data)
		return http.POST('/order/submit', data, needLoading)
	},
	//普通发起支付
	payData: (data, needLoading) => {
		return http.GET('/order/pay-data', data, needLoading)
	},
	// 货到付款发起线上支付
	meetPayData: (data, needLoading) => {
		return http.GET('/order/meet-pay-data', data, needLoading)
	},
	//获取订单列表
	getList: (data, needLoading) => {
		return http.GET('/order/list', data, needLoading)
	},
	//订单取消
	revoke: (data, needLoading) => {
		return http.GET('/order/revoke', data, needLoading)
	},
	//订单删除
	delete: (data, needLoading) => {
		return http.POST('/order/user-delete', data, needLoading)
	},
	//获取核销码
	getQrcode: (data, needLoading) => {
		return http.GET('/order/get-qrcode', data, needLoading)
	},
	//确认收货
	confirm: (data, needLoading) => {
		return http.GET('/order/confirm', data, needLoading)
	},
	// 评价预览
	commentPreview: (data, needLoading) => {
		return http.GET('/order/comment-preview', data, needLoading)
	},
	// 评价提交
	comment: (data, needLoading) => {
		return http.POST('/order/comment', data, needLoading)
	},
	// 订单详情
	detail: (data, needLoading) => {
		return http.GET('/order/detail', data, needLoading)
	},
	// 售后预览
	refundPreview: (data, needLoading) => {
		return http.GET('/order/refund-preview', data, needLoading)
	},
	// 售后提交
	refund: (data, needLoading) => {
		return http.POST('/order/refund', data, needLoading)
	},
	// 售后详情
	refundDetail: (data, needLoading) => {
		return http.GET('/order/refund-detail', data, needLoading)
	},
	// 售后订单发货
	refundSend: (data, needLoading) => {
		return http.POST('/order/refund-send', data, needLoading)
	},
	// 订单物流信息
	expressDetail: (data, needLoading) => {
		return http.GET('/order/express-detail', data, needLoading)
	},
	// 同城配送预下单
	preSubmitOrder: (data, needLoading) => {
		return http.POST('/order/pre-submit-order', data, needLoading)
	},
	// 同城配送预取消
	preCancelOrder: (data, needLoading) => {
		return http.POST('/order/pre-cancel-order', data, needLoading)
	},
	// 同城配送取消
	cancelOrder: (data, needLoading) => {
		return http.POST('/order/cancel-order', data, needLoading)
	},
	// 订单再次购买
	buyAgain: (data, needLoading) => {
		return http.POST('/cart/batch-add-cart', data, needLoading)
	},
	// 售后订单列表 
	refundList: (data, needLoading) => {
		return http.GET('/order/refund-list', data, needLoading)
	},
	// 取消售后订单 
	cancleRefund: (data, needLoading) => {
		return http.POST('/order/refund-cancel', data, needLoading)
	},
	// 删除售后订单 
	deleteRefund: (data, needLoading) => {
		return http.POST('/order/refund-delete', data, needLoading)
	},
	// 支付成功之后回调
	paySuccess: (data, needLoading) => {
		return http.POST('/order/friend_pay', data, needLoading)
	},
	// 是否在此销售区域
	checkBuyer: (data, needLoading) => {
		return http.POSTJSON('/order/check-buyer', data, needLoading)
	},
	// 是否在此销售区域
	agentIsInstall: (data, needLoading) => {
		return http.GET('/user/agent-is-install', data, needLoading)
	},
	// 拼团预览接口
	ptSubmitPreview (data, needLoading) {
		return http.POST('/pt/pt-order/submit-preview', data, needLoading)
	},
	
	// 拼团提交订单接口
	ptSubmit: (data, needLoading) => {
		return http.POST('/pt/pt-order/submit', data, needLoading)
	},

	//pt发起支付
	ptPayData: (data, needLoading) => {
		return http.GET('/pt/pt-order/pay-data', data, needLoading)
	},


	//pt发起支付
	filterMchList: (data, needLoading) => {
		return http.GET('/order/filter-mch-list', data, needLoading)
	},
	// 地图
	getLocation: (data, needLoading) => {
			return http.GET('/order/get-location', data, needLoading)
	},
}
